home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1997 / MacHack 1997.toast / Hacks / Hacks ’96 / Talking Telnet / source / Speech / StopSpeaking.c < prev   
Encoding:
C/C++ Source or Header  |  1996-06-22  |  646 b   |  41 lines  |  [TEXT/CWIE]

  1. #include    "speech.proto.h"
  2. #include    "rsdefs.h"
  3. #include    <Speech.h>
  4.  
  5.  
  6. volatile Boolean    gDoneSpeaking = false;
  7.  
  8.  
  9. void StopSpeaking(void)
  10. {
  11.     do {
  12.         if (!gCanSpeak) {
  13.             break;
  14.         }
  15.         
  16.         /* Get rid of the speech channel */
  17.         
  18.         if (nil != gSpeechChannel) {
  19.             DisposeSpeechChannel(gSpeechChannel);
  20.             gSpeechChannel = nil;
  21.         }
  22.         
  23.         /* Get rid of the text buffer */
  24.         
  25.         if (nil != gSpeechText) {
  26.             DisposeHandle(gSpeechText);
  27.             gSpeechText = nil;
  28.         }
  29.         
  30.         /* Fix the other globals */
  31.         
  32.         gDoneSpeaking = false;
  33.         gSpeakingVoiceIndex = gNumberVoices;
  34.         
  35.         /* And fix the menus */
  36.         
  37.         AdjustSpeechMenu(gSpeakSelectionEnabled);
  38.         
  39.     } while (false);
  40. }
  41.